/**
 * 自动生成！请勿修改！
 */
import { command } from '../core/command';

class ElectricityMeter {
    static categoryCode = '010020037';

    static categoryName = '电量计';

    device = {};

    opts = {};

    _to = undefined;

    constructor(opt = {}) {
        const { device, to, ...opts } = opt;

        this.device = device;
        this.opts = opts;
        this._to = to;
    }

    get categoryCode() {
        return ElectricityMeter.categoryCode;
    }

    get categoryName() {
        return ElectricityMeter.categoryName;
    }

    getCurrent(params) {
        return command({
            method: 'getCurrent',
            methodId: 'pUPQO31r',
            params,
            to: this.to?.[this.i] || this.to,
        });
    }

    getElectricityUsage(params) {
        return command({
            method: 'getElectricityUsage',
            methodId: 'p1vFB8mL',
            params,
            to: this.to?.[this.i] || this.to,
        });
    }

    getPower(params) {
        return command({
            method: 'getPower',
            methodId: 'pGox7xrZ',
            params,
            to: this.to?.[this.i] || this.to,
        });
    }

    getSwitch(params) {
        return command({
            method: 'getSwitch',
            methodId: 'ppAXiVeA',
            params,
            to: this.to?.[this.i] || this.to,
        });
    }

    getVoltage(params) {
        return command({
            method: 'getVoltage',
            methodId: 'pZgRtG3d',
            params,
            to: this.to?.[this.i] || this.to,
        });
    }

    setSwitch(params) {
        return command({
            method: 'setSwitch',
            methodId: 'peHyqS7C',
            params,
            to: this.to?.[this.i] || this.to,
        });
    }
}

export default ElectricityMeter;
